/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2022-05-03 16:13:14
 * @LastEditors: voanit
 * @LastEditTime: 2022-05-08 09:57:21
 */
import React from 'react'
// import * as obj from 'react-router-dom'
/* 
BrowserRouter=====history
HashRouter=======hash
*/
import { BrowserRouter as Router, Route, Link, Routes } from 'react-router-dom'
import Router01 from './views/Router/Router01'
import Home from './views/Router/pages/Home'
import My from './views/Router/pages/My'
import Friend from './views/Router/pages/Friend'
// console.log(obj) //  HashRouter

class App extends React.Component {
  state = {
    val: 'hello  world',
  }
  render() {
    // console.log(obj, 99)
    return (
      <Router>
        <div>
          我是一个类组件
          {/* Link=>相当于router-link */}
          <Link to="/first">页面一</Link>====
          <Link to="/two">页面二</Link>
          {/* // 在哪里写的Route,最终匹配到的组件就会渲染到这 */}
          {/* Route==>router-view   集成了router-view和路由匹配规则 */}
          <Routes>
            <Route path="/first" element={<Home></Home>}></Route>
            <Route path="/two" element={<My></My>}></Route>
          </Routes>
        </div>
      </Router>
    )
  }
}

export default App
